/**
 * @author scylla
 * @version V1.0
 * @Project echo-java-base
 * @Title 副本操纵器
 * @Description *
 * @Package concurrent.mthread.synchronizeCodeBlock
 * @Since 2021/8/18 2:55 下午
 */
package concurrent.mthread.synchronizeCodeBlock;

import java.text.MessageFormat;

public class PairManipulator implements Runnable {

    private PairManager pm;

    public PairManipulator(PairManager pm) {
        this.pm = pm;
    }

    @Override
    public void run() {
        for (; ; ) pm.increment();
    }

    @Override
    public String toString() {
        return MessageFormat.format("Pair: {0} checkCounter = {1}",pm.getPair(),pm.checkCounter.get());
    }
}
